package com.gitee.wsl.common.ui.symbol

import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Path
import com.gitee.wsl.common.ui.base.Point
import com.gitee.wsl.mathematics.geometry.shape.Square

fun Symbol.Companion.square(position: Point, radius: Float) = Square(position, radius)


fun Path.square(square: Square){
    val x = -square.radius / 2.0f
    square(square.position.x + x, square.position.y + x, square.radius, square.radius)
}

fun Path.square(x1: Float, y1: Float, x2: Float, y2: Float){
    addOval(Rect(x1,y1,x2,y2))
}